﻿@{
    ViewBag.Title = "Add Or Update Merchant";
    Layout = "~/Areas/Administrator/Views/Shared/_AdminLayout.cshtml";
}

@using Helper

<script src="@Url.ContentArea("~/Content/javascript/Merchant.js")" type="text/javascript"></script>
@Html.Action("_AddOrUpdate", "MerchantManagement", new { id = Model })

<script type="text/javascript">
    ///Document Ready jQuery
    $(document).ready(function () {

        $('#fileupload').fileupload({
            dataType: 'json',
            url: '/Administrator/MerchantManagement/UploadFiles?dir=Merchant',
            autoUpload: true,
            done: function (e, data) {
                $('#image').html('<img width=\"70px\" height=\"70px\" src="/Media/Merchant/' + data.result.name + '" />');

            }
        }).on('fileuploadprogressall', function (e, data) {
            var progress = parseInt(data.loaded / data.total * 100, 10);
            $('.progress .progress-bar').css('width', progress + '%');
        });


        $("#RegisterDate").datetimepicker({ format: 'd/m/Y' });
        $("#ActiveDate").datetimepicker({ format: 'd/m/Y' });

        $('#tSortableMerchant').dataTable({
            "iDisplayLength": 5,
            "aLengthMenu": [5, 10, 25, 50, 100],
            "sPaginationType": "full_numbers",
            "iSortingCols": "Status",
            "sSortDirections": "asc"
        });

        $('#tSortablemerchantPayment').dataTable({
            "iDisplayLength": 5,
            "aLengthMenu": [5, 10, 25, 50, 100],
            "sPaginationType": "full_numbers"
           
        });

        var config = {
            '.chosen-select': {}
        }
        for (var selector in config) {
            $(selector).chosen(config[selector]);
        }
        //********END*****************

    });
</script>